import request from '@/utils/http'; // 导入http中创建的axios实例
import qs from "qs"
const adminGoods = {
	//添加商品
	addAdminGoods(params){
		return request({
			url: '/goods/add',
			method: 'post',
			data:params
		})
	},
	//更新商品
	updateAdminGoods(params){
		return request({
			url:'/goods/update',
			method:'post',
			data:params
		})
	},
	//获取商品列表
	getAdminGoodsList(params){
		let post_param = qs.stringify(params,{indices: false })
		return request({
			url:'/goods/list?' + post_param,
			method:'get'
		})
	},
	//删除商品
	delAdminGoods(id){
		return request({
			url:'/goods/del/' + id,
			method:'delete'
		})
	}
}

export default adminGoods